import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/base/component/component.dart';
import '../models/app_model.dart';

class AppMoreCell extends StatelessWidget {
  const AppMoreCell({Key? key, required this.mod}) : super(key: key);
  final AppModel mod;

  @override
  Widget build(BuildContext context) {
    return Container(
      key: mod.key,
      padding: EdgeInsets.only(top: 10.w, bottom: 10.w),
      margin: EdgeInsets.fromLTRB(gap12, 0, gap12, gap12),
      decoration: BoxDecoration(
          color: Colors.white, borderRadius: BorderRadius.circular(circle4)),
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: gap12),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              mod.title,
              style: pfSCStyle(color: ColorsUtil.title, fontSize: font16),
            ),
            SizedBox(
              height: gap10,
            ),
            Wrap(
              runSpacing: 10.w,
              children: mod.items
                  .asMap()
                  .map((key, value) => MapEntry(
                        key,
                        MenuItemView(
                          width: (Get.width - 4 * gap12) / 5,
                          icon: loadImage(
                              url: value.icon,
                              height: 25.w,
                              width: 25.w,
                              fit: BoxFit.contain),
                          title: Text(
                            value.name,
                            style: pfMediumStyle(
                                color: ColorsUtil.title, fontSize: font12),
                          ),
                        ),
                      ))
                  .values
                  .toList(),
            )
          ],
        ),
      ),
    );
  }
}
